package cn.iocoder.yudao.module.english.dal.mysql.classes;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.english.dal.dataobject.classes.ClassesDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.english.controller.admin.classes.vo.*;

/**
 * 班级 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ClassesMapper extends BaseMapperX<ClassesDO> {

    default PageResult<ClassesDO> selectPage(ClassesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ClassesDO>()
                .likeIfPresent(ClassesDO::getClassName, reqVO.getClassName())
                .eqIfPresent(ClassesDO::getSort, reqVO.getSort())
                .eqIfPresent(ClassesDO::getClassCover, reqVO.getClassCover())
                .eqIfPresent(ClassesDO::getHeadTeacherId, reqVO.getHeadTeacherId())
                .eqIfPresent(ClassesDO::getCourseTeacherIds, reqVO.getCourseTeacherIds())
                .eqIfPresent(ClassesDO::getCampusId, reqVO.getCampusId())
                .eqIfPresent(ClassesDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(ClassesDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ClassesDO::getClassId));
    }

}